﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Windows8Accelerator.Core.Xaml.Helpers;
using Windows8Accelerator.Core.Xaml.Storage;

namespace Windows8Accelerator.Core.Xaml.Controls
{
    public partial class SuperFlyoutPage : PhoneApplicationPage
    {
        public SuperFlyoutPage()
        {
            InitializeComponent();
        }

        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            var parameter = AppHelperBase.Instance.GetNavigationParameter() as SuperFlyoutNavigationParameter;
            DataContext = parameter;

            var stringLoader = this.Resources["StringLoader"] as StringLoader;
            stringLoader.SourceFilePath = parameter.HtmlFilePath;
            await stringLoader.LoadContentAsync();
        }
    }
}